<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>tab</title>
	<style>
		*{
			margin: 0px;
			padding: 0px;
		}
		li{
			list-style: none;
		}
		.box{
			margin: 0 auto;
			width: 400px;
			height: 230px;
			padding-top: 50px;
			overflow: hidden;
		}
		.title{
			width: 400px;
			height: 30px;
			background: #F5F5F5 url() 0 0 no-repeat;
		}

		.title .item{
			width: 80px;
			height: 30px;
			font-size: 18px;
			color: #000;
			text-align: center;
			float: left;
			cursor: pointer;
		}
		.title .active{
			color: #fff;
			background: #80B600 url() 0 0 no-repeat;
		}
		.content{
			width: 2000px;
			height: 200px;
			background: blue url() 0 0 no-repeat;
			position: relative;
			left: 0px;
		}
		.content .item{
			width: 400px;
			height: 200px;
			font-size: 30px;
			color: #fff;
			text-align: center;
			line-height: 200px;
			background: #80B600 url() 0 0 no-repeat;
			float: left;
		}
		.left{
			width: 50px;
			height: 50px;
			background: red url() 0 0 no-repeat;
			float: left;
		}
		.right{
			width: 50px;
			height: 50px;
			background: red url() 0 0 no-repeat;
			float: left;
		}
	</style>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
	<script>
		
		$(function () {

			index = 0;

			$('.title .item').click(function(event) {
				index = $(this).index();
				left = index*-400;
				$(this).addClass('active').siblings().removeClass('active');
				$('.content').animate({left: left+'px'}, 500)
			});

			$('.right').click(function(event) {
				index++;
				left = index*-400;
				$('.content').animate({left: left+'px'}, 500)
			});
			$('.left').click(function(event) {
				index--;
				left = index*-400;
				$('.content').animate({left: left+'px'}, 500)
			});
			// body...
		})
	</script>
</head>
<body>
	<div class="box">
		<ul class="title">
			<li class="item active">tab1</li>
			<li class="item">tab2</li>
			<li class="item">tab3</li>
			<li class="item">tab4</li>
			<li class="item">tab5</li>
		</ul>
		<ul class="content">
			<li class="item">content1</li>
			<li class="item">content2</li>
			<li class="item">content3</li>
			<li class="item">content4</li>
			<li class="item">content5</li>
		</ul>
	</div>
	<div class="left">
		<
	</div>
	<div class="right">
		>
	</div>
</body>
</html>